/*
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 *
 * Copyright @2008 the original author or authors.
 */
package com.bluestone.scripts;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

/**
 * This is the web browser.
 * @author <a href="mailto:bluestone.daniel.q@gmail.com">daniel.q</a>
 */

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "browser", propOrder = {
	"type",	
    "path"
})
public class Browser {
	
    public static String IE8 = "IE8";
	public static String IE7 = "IE7";
    public static String IE6 = "IE6";
    public static String FIREFOX3 = "Firefox3";
    public static String FIREFOX2 = "Firefox2";
    public static String SAFARI3 = "Safari3";
    public static String SAFARI2 = "Safari2";
    public static String OPERA9 = "Opera9";
    public static String OPERA8 = "Opera8";
    
    @XmlAttribute
	private int barHeight = 120;
    
    @XmlAttribute
	private int titlebarHeight = 30;
    
    @XmlAttribute
	private String topBlankPos = "5,125";
	
    @XmlAttribute
	private String checkPos = "5,600";
	
    @XmlElement(name = "type")
	private String type = "IE7";
	
    @XmlElement(name = "path")
	private String path = "iexplore.exe";
    

	/**
	 * The height of the browser title,menu bar and the icon bar.
	 * @return barHeight - int 
	 */
	public int getBarHeight() {
		return barHeight;
	}

	public void setBarHeight(int barHeight) {
		this.barHeight = barHeight;
	}

	public String toString() {
		String str = "browser:";
		if (barHeight >= 0) {
			str = str + "barHeight=" + barHeight;
		}

		if (titlebarHeight >= 0) {
			str = str + ",titlebarHeight=" + titlebarHeight;
		}

		if (topBlankPos != null && topBlankPos.length() > 0) {
			str = str + ",topBlankPos=" + topBlankPos;
		}

		return (str);
	}

	/**
	 * The height of the browser title.
	 * @return titleBarHeight - int
	 */
	public int getTitlebarHeight() {
		return titlebarHeight;
	}

	public void setTitlebarHeight(int titlebarHeight) {
		this.titlebarHeight = titlebarHeight;
	}

	/**
	 * 
	 * @return topBlankPos that defines the top blank position in the web contents.
	 */
	public String getTopBlankPos() {
		return topBlankPos;
	}

	public void setTopBlankPos(String topBlankPos) {
		this.topBlankPos = topBlankPos;
	}

	/**
	 * 
	 * @return path that defines the installation path of the browser.
	 */
	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
	}

	/**
	 * 
	 * @return type that defines the type of the browser.
	 */
	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}


	/**
	 * 
	 * @return checkPos that defines the position of the mouse click when execute the CheckAction.
	 */
	public String getCheckPos() {
		return checkPos;
	}

	public void setCheckPos(String checkPos) {
		this.checkPos = checkPos;
	}

}
